﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <tcp_socket.h>
#include <QMainWindow>
#include <login.h>
#include <QTime>
#include <QTimer>
#include <QDate>
#include <QThread>
#include <QTreeWidgetItem>
#include <QMessageBox>
#include <QFileDialog>
#include <QLibrary>
#include <QFile>
#include <QTextStream>
#include <QTextCodec>
#include <QFileInfo>
#include <QCryptographicHash>
#include <setting.h>
namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    QTimer *timer;
    QTimer *update;
    void updata_caculate_information(QString data);
    void caculatenode_information();
    void output_task(QString information);
    QList<QTreeWidgetItem *> tree_List;
    QThread *socket_thread=NULL;
    tcp_socket *socket=NULL;
    Setting    *Mysetting=NULL;
    QString user_id="001";
    QString password;
    QList<QStringList>  caculate_task_information;
    int  caculate_page=1;
    int  caculate_column=17;
    QString target_data;                                    //DLL信息
    QString DllPath;                                        //TXT信息
    QString TaskPath;
private slots:
    void Socket_type(bool connect);
    void showtime();
    void update_data();
    void on_caculate_node_clicked();
    void on_task_data_clicked();
    void on_new_task_clicked();
    void get_id_password(QString id,QString password);
    void get_information(QStringList data);
    void on_commit_task_clicked();

    void on_search_task_clicked();

    void on_last_page_clicked();

    void on_next_page_clicked();

    void on_search_caculate_information_clicked();

    void on_task_widget_cellClicked(int row, int column);

    void on_delete_task_clicked();

    void on_reset_task_clicked();

    void on_Executive_task_clicked();

    void on_choice_DLL_clicked();



    void on_choice_task_clicked();

    void on_commit_DLL_clicked();

    void on_refresh_DLL_clicked();

signals:
    void socket_senddata(QString id,QString type,QString data);
    void socket_senddataQarray(QString id, QString type, QByteArray data);

private:
    Ui::MainWindow *ui;
    QString Md5(QString data);
    QString Md5(QByteArray data);

};

#endif // MAINWINDOW_H
